package general;

/**
 *
 * @author foliveira
 */
public class MessageQueue {
  private MessageHandler sucessor;
  private MessageHandler first;

  public MessageQueue() {
  }
  
  public void addMessageQueue(MessageHandler messageHandler){
    if(this.first==null){
      this.first = messageHandler;
    }else{
      this.sucessor.setNext(messageHandler);
    }
    this.sucessor = messageHandler;
  }
  
  public void handlerRequest(UDPMessage message){
    first.handlerRequest(message);
  }
  
}
